package demo2;

import jdk.swing.interop.SwingInterOpUtils;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Arrays;

public class DEMO_05 {
    public static void main(String[] args) throws IOException {
        Reader reader=new FileReader("d:/temp/text2.txt");
        char[] chars=new char[1024];
        while(true){
            int len = reader.read(chars);
            if(len==-1) break;
            System.out.println(len);
            for (int i = 0; i <len; i++) {
                System.out.print(chars[i]);
            }
        }

    }
}
